﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SERP.StringMappings;
using SERP.DAO;
using SERP.Controllers;
namespace SERP.Modules.SalaryFields{
	public partial class SalaryFieldsViewInfo : SERP.Modules.ModuleBase
	{
		private SalaryFieldsController controller = new SalaryFieldsController();
		public SalaryFieldsController Controller{
			get{
				return controller;
			} 
		}
		protected void Page_Load(object sender, EventArgs e){
    		LoadLanguage();	
			if(!this.IsPostBack){		
				BindInfo();	
			}
		}
		//Load All lable text
		private void LoadLanguage(){
			labelFieldCode.Text=SalaryFieldsStringMapping.FieldCode+":";
			labelFieldName.Text=SalaryFieldsStringMapping.FieldName+":";
			labelFieldNote.Text=SalaryFieldsStringMapping.FieldNote+":";
			labelFieldType.Text=SalaryFieldsStringMapping.FieldType+":";
		}
		public SalaryFieldsEntity GetObject(){
			controller.LoadObject(Int32.Parse(Request["SalaryFieldId"]));
			return controller.SalaryFieldsObject;
		}
		private void BindInfo(){
			SalaryFieldsEntity o=GetObject();		
			CopyToSreen(o);
		}
		private void CopyToSreen(SalaryFieldsEntity o){
			txtFieldCode.Text=o.FieldCode;
			txtFieldName.Text=o.FieldName;
			txtFieldNote.Text=o.FieldNote;
			txtFieldType.Text=Convert.ToString(o.FieldType);
		}   
}
}
